package org.example.hengshengexam;

import java.io.*;

public class bubbleSortTest {
    public static void main(String[] args) throws IOException {
        //读取
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StreamTokenizer in = new StreamTokenizer(br);
        //输出
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        //读取测试案例
        in.nextToken();
        int length = (int) in.nval;
        int[] arr = new int[length];
        for (int i = 0; i < length; i++) {
            in.nextToken();
            arr[i] = (int) in.nval;
        }
        bubbleSort(arr);
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < arr.length; i++) {
            sb.append(arr[i]);
            if (i < arr.length-1) {
                sb.append(" ");
            }
        }
        out.println(sb);

        //善后操作
        out.flush();
        br.close();
        out.close();

    }


    public static void bubbleSort(int[] arr) {
        int i, j;
        boolean flag = false;
        for (i = 0; i < arr.length; i++) {
            for (j = arr.length - 1; j > i; j--) {
                if (arr[j] < arr[j - 1]) {
                    int temp = arr[j];
                    arr[j] = arr[j - 1];
                    arr[j - 1] = temp;
                    flag = true;
                }
            }
            if (flag == false) {
                return;
            }
        }
    }
}